<template>
<div class="bt-warning">
    <el-popover placement="top" width="166" v-model="visible" v-if="_SHOWBTN(showBetCode)">
        <p class="clear-one">是否要删除此行？</p>
        <div style="text-align: right; margin: 0">
            <el-button size="mini" type="text" @click="visible = false">取消</el-button>
            <el-button type="primary" size="mini" @click="clear">确定</el-button>
        </div>
        <el-button slot="reference" type="SingleDeletion" v-if="_SHOWBTN(showBetCode)">删除</el-button>
    </el-popover>
</div>
</template>

<script>
export default {

    data() {
        return {
            visible: false
        };
    },
    props: ["clearOne", "id", "index", "clearOneID", "showBetCode"],
    methods: {
        clear() {

            if (this.id) {
                this.clearOne(this.id);
                this.visible = false;
            } else {
                this.clearOneID(this.index)
                // console.log("meiyou id")
                this.visible = false;
            }

        }
    }
};
</script>

<style lang="less" scoped>
/deep/.el-button--SingleDeletion {
    width: 60px;
    height: 28px;
    background: rgba(251, 54, 63, 1);
    border-radius: 4px;
    color: white;
    padding: 0;
}
</style>
